package model

import (
	"gorm.io/gorm"
	"time"
)

type Notice struct {
	Id        uint32         `gorm:"column:id;type:int UNSIGNED;comment:公告ID;primaryKey;not null;" json:"id"`                                // 公告ID
	Title     string         `gorm:"column:title;type:varchar(255);comment:标题;not null;" json:"title"`                                       // 标题
	Content   string         `gorm:"column:content;type:varchar(255);comment:内容;not null;" json:"content"`                                   // 内容
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);comment:时间;not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"` // 时间
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);not null;" json:"deleted_at"`
}

func (n *Notice) TableName() string {
	return "notice"
}
